package com.zjf.bbs.service.impl.post;

import javax.annotation.Resource;

import org.compass.core.Compass;
import org.compass.core.CompassTemplate;
import org.springframework.stereotype.Service;

import com.zjf.bbs.databean.SearchResult;
import com.zjf.bbs.entity.Post;
import com.zjf.bbs.service.post.PostSearchService;
@Service
public class PostSearchServiceImpl implements PostSearchService {
	private CompassTemplate compassTemplate;
	@Resource
	public void setCompass(Compass compass){
		compassTemplate = new CompassTemplate(compass);
	}
	
	public SearchResult<Post> query(String keyword, Integer firstIndex,
			Integer maxResult) {
		return compassTemplate.execute(new QueryCallback(keyword,firstIndex,maxResult));
	}

}
